Shader:createShader("strokes", [[
    uniform vec4 imageSize;
    uniform vec2 p1;
    uniform vec2 p2;
    uniform float thickness;
    uniform float smoothess;
    float sdSegment( in vec2 p, in vec2 a, in vec2 b )
    {
        vec2 pa = p-a, ba = b-a;
        float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 );
        return length( pa - ba*h );
    }
    float smoothstep(float a, float b, float x)
    {
        // Scale, bias and saturate x to 0..1 range
        x = clamp((x - a) / (b - a), 0.0, 1.0); 
        // Evaluate polynomial
        return x * x * (3 - 2 * x);
    }
    #ifdef PIXEL
    vec4 effect( vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords )
    {
        vec2 p = texture_coords * imageSize.xy;
        float d = sdSegment(p, p1, p2);
        float c = smoothstep(smoothess + thickness / 2, thickness / 2, d);
        return vec4(c, c, c, 1);     
    }
    #endif
    #ifdef VERTEX
    vec4 position( mat4 transform_projection, vec4 vertex_position )
    {

        return transform_projection * vertex_position;
    }
    #endif
]])